package com.example.dynamicschedule.service.impl;

import com.alibaba.fastjson.JSON;
import com.example.dynamicschedule.bean.CkOutsourcingCompany;
import com.example.dynamicschedule.dao.CkOutsourcingCompanyMapper;
import com.example.dynamicschedule.service.CkOutsourcingCompanyService;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.*;

@Service
public class CkOutsourcingCompanyServiceImpl implements CkOutsourcingCompanyService {
    @Autowired
    private CkOutsourcingCompanyMapper ckOutsourcingCompanyMapper;

    protected static final Logger logger = LoggerFactory.getLogger(CkOutsourcingCompanyServiceImpl.class);

    @Override
    public List<Map<String, Object>> getOutCompanyPowerValue(String category, String caseType, String bank, String levelName) {
        logger.info("----获取委外公司权重值---start-----category:" + category + " caseType:" + caseType + " bank：" + bank);
        Map<String, Object> map = new HashMap<>();
        map.put("category", category);
        map.put("bank", bank);
        if (null != caseType && !"".equals(caseType)) {
            map.put("caseType", caseType);
        }
        if (null != levelName && !"".equals(levelName)) {
            map.put("levelName", levelName);
        }
        List<Map<String, Object>> listPowerValue = ckOutsourcingCompanyMapper.getOutCompanyPowerValue(map);
        logger.info("----获取委外公司权重值---end:" + JSON.toJSONString(listPowerValue));
        return listPowerValue;
    }
}
